package org.bonorsoft.modules.wechat.controller;

import lombok.extern.slf4j.Slf4j;
import org.bonorsoft.common.system.base.controller.BonorController;
import org.bonorsoft.common.system.vo.Ztree;
import org.bonorsoft.modules.control.entity.Label;
import org.bonorsoft.modules.control.service.ILabelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Slf4j
@Controller
@RequestMapping("/wechat/label")
public class WxLabelController extends BonorController<Label, ILabelService> {
    @Autowired
    private ILabelService labelService;

    /**
     * 加载标签列表树
     */
    @GetMapping("/treeData")
    @ResponseBody
    public List<Ztree> treeData() {
        return labelService.selectLabelTree();
    }

}
